﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommandLine;
using CommandLine.Text;

namespace RssTools
{
    public class Options
    {
        [Option('c', "command", Required = true,
          HelpText = "Command for feed item")]
        public string Command { get; set; }
        
        [Option('f', "file", Required = true,
          HelpText = "Input feed file to be processed.")]
        public string InputFile { get; set; }

        [Option('o', "output",
          HelpText = "Output feed file to be processed.")]
        public string OutputFile { get; set; }

        [Option('t', "title",
          HelpText = "Title of the feed item.")]
        public string FeedItemTitle { get; set; }

        [Option('d', "description",
          HelpText = "Description of the feed item.")]
        public string FeedItemDescription { get; set; }

        [Option('l', "link",
         HelpText = "Link of the feed item.")]
        public string FeedItemLink { get; set; }

        [Option('g', "guid",
         HelpText = "Guid of the feed item.")]
        public string FeedItemGuid { get; set; }

        [ParserState]
        public IParserState LastParserState { get; set; }

        [HelpOption]
        public string GetUsage()
        {
            return HelpText.AutoBuild(this,
              (HelpText current) => HelpText.DefaultParsingErrorsHandler(this, current));
        }
    }
}
